{extend name="public:_base" /}
{block name="js"}
{load href="__STATIC__/admin/hui/lib/My97DatePicker/4.8/WdatePicker.js" /}
{load href="__STATIC__/echarts/echarts.common.min.js" /}
{include file="public/_validform"}
<script>
    // 绘制图表。
    echarts.init(document.getElementById('main')).setOption({
        title : {
            text: '{$Request.domain}',
            subtext: '访客统计',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'right',
        },
        series : [
            {
                name: '访问来源',
                type: 'pie',
                center: ['50%', '60%'],
                label: {
                    normal: {
                        formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                        backgroundColor: '#eee',
                        borderColor: '#aaa',
                        borderWidth: 1,
                        borderRadius: 4,
                        // shadowBlur:3,
                        // shadowOffsetX: 2,
                        // shadowOffsetY: 2,
                        // shadowColor: '#999',
                        // padding: [0, 7],
                        rich: {
                            a: {
                                color: '#999',
                                lineHeight: 22,
                                align: 'center'
                            },
                            // abg: {
                            //     backgroundColor: '#333',
                            //     width: '100%',
                            //     align: 'right',
                            //     height: 22,
                            //     borderRadius: [4, 4, 0, 0]
                            // },
                            hr: {
                                borderColor: '#aaa',
                                width: '100%',
                                borderWidth: 0.5,
                                height: 0
                            },
                            b: {
                                fontSize: 16,
                                lineHeight: 33
                            },
                            per: {
                                color: '#eee',
                                backgroundColor: '#334455',
                                padding: [2, 4],
                                borderRadius: 2
                            }
                        }
                    }
                },
                data:{$echarts},
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    });
</script>
{/block}
{block name="main"}
<div class="page-container">
    <div id="main" style=" height:500%;"></div>
    <form name="" method="get" action="">
        <div class="text-c mb-10">
            日期范围：
            <input type="text" name="start_time" id="countTimestart" onfocus="selecttime(1)" class="input-text Wdate"
                   placeholder="开始时间"
                   style="width:140px;" value="{$Think.get.start_time}" size="17" class="date" readonly>
            - <input type="text" name="end_time" id="countTimeend" onfocus="selecttime(2)" class="input-text Wdate"
                     placeholder="结束时间"
                     style="width:140px;" value="{$Think.get.end_time}" size="17" class="date" readonly>
            <button name="" class="btn radius btn-success" type="submit"><i class="Hui-iconfont"></i> 搜咨询</button>
        </div>
    </form>

    <form name="" method="post" action="{:\\think\\Url::build(\'dolistsave\')}" id="form">
        <div class="cl pd-5 bg-1 bk-gray">
    <a  class="btn radius btn-success" href="{:url(\''.\\think\\Request::instance()->controller().'/exportSN',['id'=>$Request.param.id])}" class="btnGrayS">导出Excel相关数据</a>

            <span>
                <input name="inputtype" id="style" value="" type="hidden"/>
                <input name="cid" id="style-id" value="" type="hidden"/>
                <button class="btn radius btn-danger" name="del" onclick="test(this)"><i
                        class="Hui-iconfont"></i> 删除</button>
            </span>
            <!--<span>-->
                <!--<a class="btn radius btn-success radius"-->
                   <!--href="{:url(\''.\\think\\Request::instance()->controller().'/index',['type'=>'day'])}">统计访问人数</a>-->
            <!--</span>-->
            <span>
                <a class="btn radius btn-success"
                   href="{:url(\''.\\think\\Request::instance()->controller().'/index',['type'=>'ip'])}">统计访问地址</a>
            </span><span>
                <a class="btn radius btn-success"
                   href="{:url(\''.\\think\\Request::instance()->controller().'/index',['type'=>'browser'])}">统计浏览器</a>
            </span><span>
                <a class="btn radius btn-success"
                   href="{:url(\''.\\think\\Request::instance()->controller().'/index',['type'=>'browsertype'])}">统计客户端</a>
            </span><span>
                <a class="btn radius btn-success"
                   href="{:url(\''.\\think\\Request::instance()->controller().'/index',['type'=>'network'])}">统计关键词</a>
            </span><span>
                <a class="btn radius btn-success"
                   href="{:url(\''.\\think\\Request::instance()->controller().'/index',['type'=>'antepage'])}">统计搜索引擎</a>
            </span>
            <span class="r">共有数据：<strong>{$num}</strong> 条</span>
        </div>

        <div class="mt-10">
            <table class="layui-table">
                <thead>
                <tr class="text-c">
                    <th width="25"><input name="" type="checkbox" value=""></th>
                    <th width="40">ip地址</th>
                    <th width="100">地址</th>
                    <th width="100">来源</th>
                    <th width="100" class="hidden-xs">搜索引擎</th>
                    <th width="100" class="hidden-xs">关键词</th>
                    <th width="100"  class="hidden-xs">{:sort_by('访问时间','create_time')}</th>
                    <th width="100">操作</th>
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo" empty="$_html_empty"}
                <tr class="text-c va-m">
                    <td><input name="id[]" type="checkbox" value="{$vo.id}"></td>
                    <td>{$vo.ip}</td>
                    <td class="text-l">
                        {$vo.dizhi}
                    </td>
                    <td >
                        {$vo.visitpage}
                    </td>
                    <td class="hidden-xs">
                        {$vo.antepage}
                    </td>
                    <td class="hidden-xs">
                        {$vo.network}
                    </td>
                    <td  class="hidden-xs">
                        {$vo.create_time}
                    </td>
                    <td class="td-manage">
                        <!--<a style="text-decoration:none" class="btn radius btn-xs btn-danger"-->
                           <!--onClick="del_old(this,'{:url(\''.\\think\\Request::instance()->controller().'/del',['id'=>$vo.id])}','10001')"-->
                           <!--href="javascript:;"-->
                           <!--title="删除">删除</a>-->
                        <a style="text-decoration:none" class="btn radius btn-xs btn-danger"
                           onClick="del('{:url(\''.\\think\\Request::instance()->controller().'/del')}',{$vo.id})"
                           href="javascript:;"
                           title="删除">删除</a>
                    </td>
                </tr>
                {/volist}
                </tbody>

            </table>
        </div>
    </form>
    {$list->render()}
</div>
{/block}